<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="../../js/jquery-3.4.1.min.js"></script>
</head>
<body>
  
  <script>
    $.ajax({
      type: "get",
      url: "https://api.darksky.net/forecast/2bc2b9a4a6d66f1f44217dc2c919bcb6/37.8267,-122.4233",
      data: "",
      dataType: "jsonp",
      success: function (response) {
        var arr_alerts = response.alerts;
        for(let i in arr_alerts){
          var str = "";
          let obj = arr_alerts[i];
          // console.log(obj.title);
          str += i + "-------" + obj.title + ":";
          let arr_regions = obj.regions;
          for(let i in arr_regions){
            // console.log(arr_regions[i]);
            str += arr_regions[i]+","
          }
          console.log(str);
        }
        // console.log()
      }
    });
    // var response;
    // var arr_category = response.category; 
    // for(let i in arr_category){
    //   arr[i]
    // }
    // var obj_results  = response.results;
    // var arr1 = obj.Android;//数组
    // for(let i in arr1){
    //   let obj1 = arr1[i];
    //   obj1._id
    // }
  </script>
</body>
</html>